<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
  <script src="/js/jquery-1.11.2.min.js"></script>
  <script src="/js/jweixin-1.0.0.js"></script>
  <script>
    wx.config({
      debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
      appId: '${appId}', // 必填，公众号的唯一标识
      timestamp:'${timestamp}', // 必填，生成签名的时间戳
      nonceStr: '${nonceStr}', // 必填，生成签名的随机串
      signature: '${signature}',// 必填，签名，见附录1
      jsApiList: [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'hideMenuItems',
        'showMenuItems',
        'hideAllNonBaseMenuItem',
        'showAllNonBaseMenuItem',
        'translateVoice',
        'startRecord',
        'stopRecord',
        'onRecordEnd',
        'playVoice',
        'pauseVoice',
        'stopVoice',
        'uploadVoice',
        'downloadVoice',
        'chooseImage',
        'previewImage',
        'uploadImage',
        'downloadImage',
        'getNetworkType',
        'openLocation',
        'getLocation',
        'hideOptionMenu',
        'showOptionMenu',
        'closeWindow',
        'scanQRCode',
        'chooseWXPay',
        'openProductSpecificView',
        'addCard',
        'chooseCard',
        'openCard'
      ]
    });
    wx.ready(function () {
      document.querySelector('#getLocation').onclick = function () {
        wx.getLocation({
          success: function (res) {
            alert(JSON.stringify(res));
          },
          cancel: function (res) {
            alert('用户拒绝授权获取地理位置');
          }
        });
      };

      document.querySelector('#chooseWXPay').onclick = function () {
        wx.chooseWXPay({
          timestamp: 1414723227,
          nonceStr: 'noncestr',
          package: 'addition=action_id%3dgaby1234%26limit_pay%3d&bank_type=WX&body=innertest&fee_type=1&input_charset=GBK&notify_url=http%3A%2F%2F120.204.206.246%2Fcgi-bin%2Fmmsupport-bin%2Fnotifypay&out_trade_no=1414723227818375338&partner=1900000109&spbill_create_ip=127.0.0.1&total_fee=1&sign=432B647FE95C7BF73BCD177CEECBEF8D',
          signType: 'SHA1',
          paySign: 'bd5b1933cda6e9548862944836a9b52e8c9a2b69'
        });
      };
    });
  </script>
</head>
<body>
  <button class="btn btn_primary" id="getLocation">getLocation</button>
  <button class="btn btn_primary" id="chooseWXPay">chooseWXPay</button>
  <div>ticket1:${ticket}</div>
  <div>nonceStr:${nonceStr}</div>
  <div>signature:${signature}</div>
  <div>timestamp:${timestamp}</div>
  <div>url:${url}</div>
</body>
</html>
